/**
 * 广寒宫
 * 网址:www.guanghangong.xyz
 */
package org.moon.framework.sample.boot.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.moon.framework.autoconfigure.secure.annotation.FormRepeat;
import org.moon.framework.autoconfigure.secure.annotation.PreAuth;
import org.moon.framework.autoconfigure.springmvc.response.R;
import org.moon.framework.autoconfigure.syslog.annotation.SysLog;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * boot相关测试
 *
 * @author moon
 */
@RestController
@Api(tags = "boot测试")
public class MyController {

    @GetMapping(value = "/token")
    @ApiOperation(value = "token测试")
    public R<Void> token() {
        return R.success();
    }

    @GetMapping(value = "/sysLog")
    @SysLog(mod = "测试好了吗", fun = "11212")
    @ApiOperation(value = "日志测试")
    public R<Void> sysLog() {
        return R.success();
    }

    @GetMapping(value = "/formRepeat")
    @FormRepeat
    @ApiOperation(value = "表单重复提交")
    public R<Void> formRepeat() {
        return R.success();
    }

    @GetMapping(value = "/preAuth")
    @PreAuth("1")
    @ApiOperation(value = "权限测试")
    public R<Void> preAuth() {
        return R.success();
    }
}
